
#include <stdio.h>
int main()
{
    int n, an;
    while (~scanf("%d", &n)) {
        an = 2 + (n - 1) * 3;
        //等差数列第n项计算
        printf("%d\n", n * (2 + an) / 2);
        //等差数列求和打印
    }
    return 0;
}